package Chapter10_InnerClass;

/**
 * Date: 2019/2/21
 * Time: 9:33
 * User: Driss.
 * 10.7 嵌套类
 */
public class Parcel11 {

    //嵌套类
    private static class ParcelContents implements Contents{
        private int i = 11;
        public int value(){return i;}
    }

    //嵌套类
    protected static class ParcelDestination implements Destination{
        private String label;
        private ParcelDestination(String whereTo){
            label = whereTo;
        }
        public String readLabel(){return label;}

        public static void f(){}
        static int x = 10;
        static class AnotherLever{
            public static void f(){}
            static int x = 10;
        }
    }


    public static Destination destination(String s){
        return new ParcelDestination(s);
    }

    public static Contents contents(){
        return new ParcelContents();
    }

    public static void main(String[] args) {
        Contents c = contents();
        Destination tasmania = destination("Tasmania");
    }

}
